<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //1、获取相对于浏览器可视窗口的xy坐标
        document.addEventListener('click',function(e){
            console.log(e.clientX);
            console.log(e.clientY);
        })
         //2、获取相对于文档的xy坐标
         document.addEventListener('click',function(e){
            console.log(e.pageX);
            console.log(e.pageY);

        })
         //3、获取相对于电脑屏幕的xy坐标
         document.addEventListener('click',function(e){
            console.log(e.screenX);
            console.log(e.screenY);

        })
    </script>
</body>
</html>